package com.zeroone.star.publish.comp;

import com.zeroone.star.project.dto.notify.SampleNotifyDTO;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Description 消息发布组件
 * @Author lyx
 * @since 2024/11/8 21:48
 */

@Component
public class RmPublish {
    @Resource
    Source source;

    public void publishNotify(SampleNotifyDTO message){
        source.output().send(MessageBuilder.withPayload(message).build());
    }
}
